<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport"
	      content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">

	<title>GugeeData-Instagram达人与电商数据分析平台</title>
	<meta name="description" content="GugeeData是专业的Instagram数据分析工具，提供Instagram素材分析、达人分析、电商分析、品牌分析等功能，助力跨境电商">
	<meta name="keywords" content="GugeeData,Instagram数据分析,Instagram带货数据,Instagram排行榜,Instagram热门商品,Instagram热门素材，Instagram热门达人">
	<meta property="og:title" content="GugeeData-Instagram达人与电商数据分析平台">
	<meta property="og:description" content="GugeeData是专业的Instagram数据分析工具，提供Instagram素材分析、达人分析、电商分析、品牌分析等功能，助力跨境电商">
	<meta property="og:type" content="website">
	<meta property="og:url" content="https://gugee.xiguaji.com/">

	<link rel="icon" href="${request.contextPath}/static/img/favicon.ico" type="image/x-icon"/>
	<link rel="shortcut icon" href="${request.contextPath}/static/img/favicon.ico" type="image/x-icon"/>
	<link rel="preconnect" href="https://fonts.gstatic.com">
	<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap" rel="stylesheet">
	<link rel="stylesheet" href="//at.alicdn.com/t/font_1880456_bo4iko3ec4b.css">
	<link rel="stylesheet" href="${request.contextPath}/static/css/reset.css">
	<link rel="stylesheet" href="${request.contextPath}/static/css/gd-ui.css">
	<link rel="stylesheet" href="${request.contextPath}/static/css/ins/common.css">
	<link rel="stylesheet" href="/static/css/ins/index_cn.css">
</head>
<body>
<main>
	<aside class="fixBox">
        <#if isMobile == false>
			<a href="https://wpa.qq.com/msgrd?v=3&uin=2880446373&site=qq&menu=yes">
				<div class="circle2">
					<i class="iconfont iconQQ-16px"></i>
				</div>
			</a>
        <#else>
			<a href="mqqwpa://im/chat?chat_type=wpa&uin=2679571084&version=1&src_type=web&web_src=www.gugeedata.com">
				<div class="circle2 link-qq">
					<i class="iconfont iconQQ-16px"></i>
				</div>
			</a>
        </#if>
		<a href="#top">
			<div class="circle2 link-top">
				<i class="iconfont iconbacktotop"></i>
			</div>
		</a>
	</aside>
	<#if login == true>
		<aside>
			<section class="main-menu">
				<div class="menu-top">
					<div class="left">
						<img class="head-logo" src="/static/img/logo.png" srcset="/static/img/logo@2x.png 2x" alt="logo">
					</div>
					<div class="center">Gugee Data</div>
					<div class="right" id="menuClose">
						<i class="iconfont iconbuzhichi"></i>
					</div>
				</div>
				<div class="menu-body">
					<div class="user-info">
						<div class="avatar">
							<i class="iconfont iconUser"></i>
						</div>
						<div class="right">
							<div class="title">${user.email!''}</div>
							<div class="sub-title">
                                <#switch user.roleId>
                                    <#case 1>
										<span class="role-ver">免费版</span>
                                        <#break>
                                    <#case 2>
										<span class="role-ver blue">高级版</span>
                                        <#break>
                                    <#case 3>
										<span class="role-ver orange">豪华版</span>
                                        <#break>
                                    <#case 4>
										<span class="role-ver red">专业版</span>
                                        <#break>
                                    <#case 5>
										<span>至尊版</span>
                                        <#break>
                                </#switch>
							</div>
						</div>
					</div>
					<div class="menu-info">
						<div class="menu-item">
							<a href="https://www.gugeedata.com/">进入工作台</a>
						</div>
						<div class="menu-item">
							<span id="loginOutSpan">登出</span>
						</div>
					</div>
				</div>
			</section>
		</aside>
	</#if>
	<aside>
		<section class="login-section">
			<div class="login-header">
				<i id="loginClose" class="iconfont iconbuzhichi"></i>
			</div>
			<div class="login-body">
				<div class="login-wrap">
					<form class="gd-form" id="loginForm">
						<div class="title">登录</div>
						<div class="gd-form-item">
							<input class="gd-input" type="text" name="email" id="loginEmail" placeholder="邮箱">
						</div>
						<div class="gd-form-item">
							<input class="gd-input" type="password" name="password" id="loginPwd" placeholder="密码">
						</div>
						<div class="gd-form-item" style="margin-top: 0;">
							<div class="extra-row">
								<div class="left" id="remCheckbox">
									<input type="checkbox">
									<span style="cursor: pointer;" >记住账号</span>
								</div>
								<div class="right">
									<a href="#forgot">忘记密码</a>
								</div>
							</div>
						</div>
						<div class="gd-form-item">
							<button type="button" class="gd-btn btn-info" id="loginBtn">登录</button>
						</div>
						<p class="bottom-tip">还没有账号？<a href="#register">注册账号</a></p>
					</form>
					<form class="gd-form" id="registerForm">
						<div class="title">注册</div>
						<div class="gd-form-item">
							<input class="gd-input" type="text" name="email" id="registerEmail" placeholder="邮箱">
						</div>
						<div class="gd-form-item">
							<div class="gd-input-group">
								<input class="gd-input" maxlength="6" oninput="if(value.length>6)value=value.substring(0,6)" type="text" name="password" id="registerCode" placeholder="请输入验证码">
								<div class="gd-input__append">
									<button class="gd-btn btn-info" id="registerCodeBtn" type="button">验证码</button>
								</div>
							</div>
						</div>
						<div class="gd-form-item">
							<input class="gd-input" type="password" name="password" id="registerPwd" placeholder="密码（请输入至少 6 位密码）">
						</div>
						<p class="tip">注册即表示已阅读并接受《用户协议》</p>
						<div class="gd-form-item">
							<button type="button" class="gd-btn btn-info" id="registerBtn">确认</button>
						</div>
						<p class="bottom-tip">已有账号？<a href="#login">登录</a></p>
					</form>
					<form class="gd-form" id="forgetForm">
						<div class="title">忘记密码</div>
						<div class="gd-form-item">
							<input class="gd-input" type="text" name="email" id="forgotEmail" placeholder="邮箱">
						</div>
						<div class="gd-form-item">
							<input class="gd-input" maxlength="6" oninput="if(value.length>6)value=value.substring(0,6)" type="text" name="password" id="forgotCode" placeholder="请输入验证码">
							<div class="gd-input__append">
								<button type="button" class="gd-btn btn-info" id="forgotCodeBtn">验证码</button>
							</div>
						</div>
						<div class="gd-form-item">
							<input class="gd-input" type="password" name="password" id="forgotPwd" placeholder="新密码">
						</div>
						<div class="gd-form-item" style="margin-top: 24px;">
							<button type="button" class="gd-btn btn-info" id="forgotBtn">确认</button>
						</div>
						<p class="bottom-tip">还没有账号？<a href="#register">注册账号</a></p>
					</form>
				</div>
			</div>
		</section>
	</aside>
	<div class="bground">
		<div class="head">
			<img class="head-logo" src="/static/img/logo.png" srcset="/static/img/logo@2x.png 2x" alt="logo">
			<p class="headp1">Gugee Data</p>
			<#if login == false>
				<a href="#login">
					<button id="headBtn" class="gd-btn btn-info button1">登录/注册</button>
				</a>
			<#else>
                <#if isMobile == false>
	                <div class="right">
		                <div class="header-user-info">
			                <span>${user.email} </span>
                            <#switch user.roleId>
                                <#case 1>
					                <span class="role-ver">免费版</span>
                                    <#break>
                                <#case 2>
					                <span class="role-ver blue">高级版</span>
                                    <#break>
                                <#case 3>
					                <span class="role-ver orange">豪华版</span>
                                    <#break>
                                <#case 4>
					                <span class="role-ver red">专业版</span>
                                    <#break>
                                <#case 5>
					                <span>至尊版</span>
                                    <#break>
                            </#switch>
			                <i class="iconfont iconsort-down"></i>
			                <div class="header_affix">
				                <div class="gd-btn login-out" id="loginOutBtn">登出</div>
			                </div>
		                </div>
		                <div class="line"></div>
		                <a href="https://www.gugeedata.com/" class="link-tx">进入工作台</a>
	                </div>
                <#else>
	                <div class="right" id="menuIcon">
		                <i class="iconfont iconmenu-burger2"></i>
	                </div>
                </#if>

			</#if>
		</div>
		<h1>Instagram 数据分析平台</h1>
		<h2>快速挖掘火热素材、畅销商品，智能匹配优质达人，助力 Instagram 变现</h2>
		<#if login == false>
			<a href="#login" class="link-gugee" data-url="https://www.gugeedata.com/instagram/search">
				<button class="gd-btn btn-info button2">立即体验</button>
			</a>
		<#else>
			<a href="https://www.gugeedata.com/instagram/search">
				<button class="gd-btn btn-info button2">立即体验</button>
			</a>
		</#if>
	</div>
	<div class="body1">
		<div class="list1">
			<h3 class="body1p1">素材分析</h3>
			<p class="body1p2">运营者的灵感瀑布</p>
			<p class="body1p3">AI 智能分析帮您快速找出不同类型的火爆素材，助您轻松运营 Instagram 账号。</p>
			<ul class="intro-info">
				<li class="intro-item">
					<img src="/static/img/tick.png" width="16" height="16" alt="tick">
					<div>优质素材飞速筛选，多行业热点素材任你挑</div>
				</li>
				<li class="intro-item">
					<img src="/static/img/tick.png" width="16" height="16" alt="tick">
					<div>同量及达人帖子对比，帖子质量一目了然</div>
				</li>
			</ul>
			<#if login == false>
				<a href="#login" class="link-gugee" data-url="https://www.gugeedata.com/instagram/hot-instagram-posts">
					<button class="gd-btn btn-info-light">查看热门素材</button>
				</a>
			<#else>
				<a href="https://www.gugeedata.com/instagram/hot-instagram-posts">
					<button class="gd-btn btn-info-light">查看热门素材</button>
				</a>
			</#if>
		</div>
		<div class="item1">
			<img class="img2" src="/static/img/Item1_cn.png">
		</div>
	</div>
	<div class="body2">
		<div class="wrap">
			<div class="item2">
				<img class="img3" src="/static/img/Item2_cn.png">
			</div>
			<div class="list2">
				<h3 class="body2p1">达人分析</h3>
				<p class="body2p2">快速匹配优质达人</p>
				<p class="body2p3">多维度达人搜索功能，全方位的达人分析，帮您快速找到符合您定位的优质达人。</p>
				<ul class="intro-info">
					<li class="intro-item">
						<img src="/static/img/tick.png" width="16" height="16" alt="tick">
						丰富多样的达人数据库，覆盖全世界热点达人
					</li>
					<li class="intro-item">
						<img src="/static/img/tick.png" width="16" height="16" alt="tick">
						达人账户质量、粉丝受众一站分析，达人传播力尽在眼底
					</li>
				</ul>
                <#if login == false>
					<a href="#login" class="link-gugee" data-url="https://www.gugeedata.com/instagram/search">
						<button class="gd-btn btn-info-light">搜索热门达人</button>
					</a>
                <#else>
					<a href="https://www.gugeedata.com/instagram/search">
						<button class="gd-btn btn-info-light">搜索热门达人</button>
					</a>
                </#if>
			</div>
		</div>
	</div>
	<div class="body3">
		<div class="list3">
			<h3 class="body3p1">商品分析</h3>
			<p class="body3p2">电商带货风向早知道</p>
			<p class="body3p3">挖掘热点商品，紧跟行业时尚潮流，优化商品投放策略，助力跨境电商。</p>
			<ul class="intro-info">
				<li class="intro-item">
					<img src="/static/img/tick.png" width="16" height="16" alt="tick">
					热推商品一览无余，全品类商品供你参考
				</li>
				<li class="intro-item">
					<img src="/static/img/tick.png" width="16" height="16" alt="tick">
					商品推广方式全盘掌握，飞速挖掘带货达人
				</li>
			</ul>
			<#if login == false>
				<a href="#login" class="link-gugee" data-url="https://www.gugeedata.com/instagram/product-search">
					<button class="gd-btn btn-info-light">查看热门商品</button>
				</a>
			<#else>
				<a href="https://www.gugeedata.com/instagram/product-search">
					<button class="gd-btn btn-info-light">查看热门商品</button>
				</a>
			</#if>
		</div>

		<div class="item3">
			<img class="img4" src="/static/img/Item3_cn.png">
		</div>
	</div>
	<div class="round" style="display: none">
		<div class="bground3">
			<div class="list4">
				<p class="list4p1">Gugee Data</p>
				<p class="list4p2">专业的 Instagram 数据分析软件 </p>
			</div>
			<div class="wide">
				<button class="gd-btn btn-info button6">免费试用</button>
			</div>
		</div>
	</div>
</main>
<footer>
	<div class="bground4">
		<div class="end">
			<div class="list5">
				<div class="list6">
					<p class="endp1">
						微信公众号
					</p>
					<div class="ewm">
						<img class="img5" src="/static/img/qrcode_cn.jpg" srcset="/static/img/qrcode_cn@2x.jpg 2x">
						<p class="endp2">
							欢迎关注 Gugee Data 微信公众号，及时了解Instagram 行业动向,第一时间更新功能资讯。
						</p>
					</div>
				</div>
				<div class="list7">
					<p class="endp4">联系我们</p>
					<#if isMobile == false>
						<a href="https://wpa.qq.com/msgrd?v=3&uin=2880446373&site=qq&menu=yes">
							<div class="circle2">
								<i class="iconfont iconQQ-16px"></i>
							</div>
						</a>
				    <#else>
					    <a href="mqqwpa://im/chat?chat_type=wpa&uin=2679571084&version=1&src_type=web&web_src=www.gugeedata.com">
						    <div class="circle2">
							    <i class="iconfont iconQQ-16px"></i>
						    </div>
					    </a>
					</#if>
				</div>
			</div>
			<hr class="hr1"/>
			<p class="endp3">
				Copyright © 2020 Gugee Data.com
			</p>
		</div>
	</div>
</footer>
<script>
    const gugeeGobal = {
        isMobile: ${isMobile?c},
        roleId: +${(user.roleId)!'0'},
        isLogin: !!'${login?string('1', '')}'
    }
</script>
<script src="${request.contextPath}/static/plugins/axios.min.js"></script>
<script src="${request.contextPath}/static/js/request.js"></script>
<script src="${request.contextPath}/static/js/base.js"></script>
<script type="module">
    initEvent()

	function initEvent() {
        const linkTop = document.querySelector('.link-top')
        window.addEventListener('scroll', debounce(() => {
               if(getScroll().top > (window.screen.height / 2)) {
                   linkTop.show('flex')
               } else {
                   linkTop.hide()
               }
        }, 100))
		document.querySelectorAll('.link-gugee').forEach(item => {
            item.addEventListener( 'click', e => {
		        const url = item.getAttribute('data-url')
			    sessionStorage.setItem('toPath', url)
		    })

		})
        window.addEventListener('popstate', () => {
            history.pushState(null, null, document.URL)
            const url = document.URL
            document.querySelectorAll('.gd-form').forEach(item => {
                item.hide()
            })
            if(url.indexOf('#login') > -1) {
                showLoginModal()
            } else if(url.indexOf('#register') > -1) {
                showLoginModal(1)
            } else if(url.indexOf('#forgot') > -1) {
                showLoginModal(2)
            }
        })

        const loginOutBtn = document.getElementById('loginOutBtn')
		if(gugeeGobal.isLogin) {
			if(gugeeGobal.isMobile) {
				const menuIcon = document.getElementById('menuIcon')
                menuIcon.addEventListener('click', () => {
					document.querySelector('.main-menu').show()
                })
				const menuClose = document.getElementById('menuClose')
                menuClose.addEventListener('click', () => {
                    document.querySelector('.main-menu').hide()
				})
                const loginOutSpan = document.getElementById('loginOutSpan')
                loginOutSpan.addEventListener('click', () => {
                    document.querySelector('.main-menu').hide()
                    loginOut()
                })
			} else {
                const headerAffix = loginOutBtn.parentElement
                const headerInfo = document.querySelector('.header-user-info')
                headerInfo.addEventListener('mouseover', () => {
                    headerAffix.show()
                })
                headerInfo.addEventListener('mouseout', () => {
                    headerAffix.hide()
                })
                loginOutBtn.addEventListener('click', loginOut)
			}
		}

	    const checkboxSpan = document.querySelector('#remCheckbox span')
        checkboxSpan.addEventListener('click', () => {
            const e = checkboxSpan.previousElementSibling
            e.checked = !e.checked
	    })

		const loginClose = document.getElementById('loginClose')
        const loginWrap = document.querySelector('.login-section')
        loginClose.addEventListener('click', () => {
            hideMask()
            loginWrap.removeAttribute('style')
            loginWrap.hide()
            history.replaceState(null,null, '/instagram/cn')
        })

		const loginBtn = document.getElementById('loginBtn')
		loginBtn.addEventListener('click', () => {
            login()
		})

		const registerCodeBtn = document.getElementById('registerCodeBtn')
        registerCodeBtn.addEventListener('click', () => {
            const email = document.getElementById('registerEmail')
            checkExistEmail(email.value,registerCodeBtn)
        })

        const forgotCodeBtn = document.getElementById('forgotCodeBtn')
        forgotCodeBtn.addEventListener('click', () => {
            const email = document.getElementById('forgotEmail')
            checkExistEmail(email.value,forgotCodeBtn)
        })

		const forgotBtn = document.getElementById('forgotBtn')
        forgotBtn.addEventListener('click', forgotSubmit)

		const registerBtn = document.getElementById('registerBtn')
        registerBtn.addEventListener('click', signSubmit)
	}

	function showLoginModal(type = 0) {
	    const loginWrap = document.querySelector('.login-section')
		if(gugeeGobal.isMobile) {
		    if(!loginWrap.style.top) {
                loginWrap.style.top = getScroll().top + 'px'
		    }
		} else {
            loginWrap.style.top = 'calc(40% + ' + getScroll().top + 'px)'
		}
        loginWrap.show()
        showMask({
	        zIndex: 0,
	        event: () => {
                loginWrap.hide()
	            history.replaceState(null,null, '/')
	        }
        })

	    switch (type) {
	        case 0:
				document.getElementById('loginForm').show()
				break
		    case 1:
                document.getElementById('registerForm').show()
		        break
		    case 2:
                document.getElementById('forgetForm').show()
		        break
	    }
    }
    function login(email, pwd) {
	    email = email || document.getElementById('loginEmail').value
	    pwd = pwd || document.getElementById('loginPwd').value
        showLoading()
        _axios.post('/v1/login', {
            email:email,
            password: pwd
        }).then(res => {
            hideLoading()
            if(res.Code === 200) {
               /* const data=JSON.stringify({
                    msg:'login info',
                    token: res.Data
                })*/

                const loginWrap = document.querySelector('.login-section')
                hideMask()
                loginWrap.removeAttribute('style')
                loginWrap.hide()
                history.replaceState(null,null, '/')

                showModal({
                    content: '登录成功，由于Instagram是海外平台，因此网站为英文版，部分图片需要海外网络才能加载，同时使用海外网络速度会更快，请知晓！',
                    isShowConfirmBtn: false,
                    cancelBtnText: '正在跳转中....',
                    confirmBtn: {
                        event: e => {
                            e.preventDefault()
                        }
                    }
                })
	            const authorized = res.Data
                setTimeout(() => {
                    if(sessionStorage.getItem('toPath')) {
                        window.location.href = sessionStorage.getItem('toPath') + '?authorized=' + authorized
                    } else {
                        window.location.href = 'https://www.gugeedata.com?authorized=' + authorized
                    }
                    sessionStorage.removeItem('toPath')
                }, 2000)
            } else {
                showToast(res.Msg)
            }
        })
    }

    const getQueryByUrl = key => {
        const reg = new RegExp('[?|&]' + key + '=([^&]*)')
        const matches = location.href.match(reg)
        if (matches && matches[1]) {
            return matches[1]
        }
    }
    const chl = getQueryByUrl('chl')
    if(chl) {
        sessionStorage.setItem('chl', chl)
    }
    function signSubmit() {
        let code = document.getElementById('registerCode').value
        let email = document.getElementById('registerEmail').value
        let pwd = document.getElementById('registerPwd').value
        if(!code){
            showToast('please check Verification code')
            return false
        }
        if(!email || !checkEmail(email)) {
            showToast('please check Email')
            return false
        }
        if(!pwd || pwd.length < 6) {
            showToast('please check Password')
            return false
        }
        showLoading()
        const chl = sessionStorage.getItem('chl')
        let url = '/v1/register'
        if(chl) {
            url += '?chl=' + chl
        }
        _axios.post(url, {
            code:code,
            email: email,
            password: pwd
        }).then(res => {
            if(res.Code === 200){
                login(email,pwd)
            } else {
                showToast(res.Msg)
                hideLoading()
            }
        })
    }
    function checkExistEmail(email,btn) {
        btn.showLoading()
        _axios.post('/v1/validate/email/register', {
            email: email
        }).then(res => {
            if(res.Code === 200) {
                sendCode(email,btn)
            } else {
                btn.hideLoading()
                showToast(res.Msg)
            }
        })
    }
    function forgotSubmit() {
        let code = document.getElementById('forgotCode').value
        let email = document.getElementById('forgotEmail').value
        let pwd = document.getElementById('forgotPwd').value
        if(!code){
            showToast('please check Verification code')
            return false
        }
        if(!email || !checkEmail(email)) {
            showToast('please check Email')
            return false
        }
        if(!pwd || pwd.length < 6) {
            showToast('please check Password')
            return false
        }
        showLoading()
        _axios.put('/v1/user/rest/pwd', {
            code:code,
            email: email,
            newPassword: pwd
        }).then(res => {
            if(res.Code === 200){
                login(email, pwd)
            } else {
                hideLoading()
                showToast(res.Msg)
            }
        })
    }
    function loginOut() {
        showLoading()
        _axios.get('/v1/login/out').then((res) => {
            if (res.Code === 200) {
                window.location.reload()
            } else {
                hideLoading()
            }
        })
    }
    function sendCode(email, btn) {
        if(!email || !checkEmail(email)) {
            showToast('please check Email')
            return false
        }
        btn.showLoading()
        let second = 60
        _axios.post('/v1/send/code', {
            email: email
        }).then(res => {
            showToast(res.Msg, 1000)
            btn.hideLoading()
            btn.removeAttribute('style')
            if(res.Code === 200) {
                btn.style.color = '#909399'
                btn.style.backgroundColor = '#F5F7FA'
                btn.style.border = '1px solid #dcdfe6'
                btn.setAttribute('disabled', 'disabled')
                btn.innerText = second + 's'
                second --
                let timer = setInterval(() => {
                    if(second < 1) {
                        clearInterval(timer)
                        btn.innerText = '验证码'
                        btn.removeAttribute('style')
                        btn.removeAttribute('disabled')
                        return false
                    }
                    btn.innerText = second + 's'
                    second --
                }, 1000)
            }
        })
    }
</script>
</body>
</html>
